#pragma once

#include "camera.h"

OPEN_JLIB_NS


struct Director;
struct Space : public Node {

  using Node::Node;

  virtual void dispatchDraw ();

  void dispatchDraw (const Mat4& pv, const Mat4& p, const Mat4& v, const Mat4& m) override;

  const Mat4& getSpaceMatrix () override;


  void addCamera (CameraNode *camera, s64 updateOrder = 0L, s64 drawOrder = 0L) noexcept;


  CameraNode* currentCamera () noexcept {
    return _currentCamera;
  }

  Queue<CameraNode, &CameraNode::_cameraList> cameras () noexcept { return &_cameras; }

protected:
  List _cameras;
  CameraNode* _currentCamera = nullptr;
};


CLOSE_JLIB_NS
